package com.smarthome.domain.enums;

public enum ShUserSuperFlagEnum {

    NORMAL(0, "普通用户"), 
    SUPER(1, "超级管理员");

    private int flag;
    private String comment;

    private ShUserSuperFlagEnum(int flag, String comment) {
        this.flag = flag;
        this.comment = comment;
    }

    public int getFlag() {
        return flag;
    }

    public String getComment() {
        return comment;
    }

    public static ShUserSuperFlagEnum getByFlag(int flag) {
        for (ShUserSuperFlagEnum subEnum : values()) {
            if (subEnum.getFlag() == flag) {
                return subEnum;
            }
        }
        throw new IllegalArgumentException("none-defined ShPropertyUserSuperFlagEnum,flag:" + flag);
    }

}
